// 根组件, 里面放一些子组件
// App > Login + Home

// 1. 导入
import React from 'react'
import { BrowserRouter, Route, Redirect, Switch } from 'react-router-dom'

import Home from '@/pages/Home'
// import Home from './pages/Home'
import Login from '@/pages/Login'

import One from '@/pages/Test/One'
import Two from '@/pages/Test/Two'

// 2. 创建
class App extends React.Component {
  render() {
    return (
      <BrowserRouter>
        <Switch>
          <Redirect exact from="/" to="/login"></Redirect>
          <Route path="/login" component={Login}></Route>
          <Route path="/home" component={Home}></Route>
          {/* 下面是测试用的 */}
          <Route path="/one" component={ One }></Route>
          <Route path="/two" component={ Two }></Route>
        </Switch>
      </BrowserRouter>
    )
  }
}

// 3. 导出
export default App
